Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Answers for Microsoft .NET Online Test - Online Exam - Online Quiz - Mock Test

←Go Back to Online Practice Test

Ques. You are developing a custom event handler to automatically print all

open documents.

The event handler helps specify the number of copies to be printed. You need to develop a custom event arguments class to pass as a parameter
to the event handler.
Which code segment should you use?
Option 1. public class PrintingArgs {
private int copies;
public PrintingArgs(int numberOfCopies) { this.copies = numberOfCopies;
}
public int Copies {
get { return this.copies; }
}}
Option 2. public class PrintingArgs : EventArgs {
private int copies;
public PrintingArgs(int numberOfCopies) { this.copies = numberOfCopies;
}
public int Copies {
get { return this.copies; }
}}
Option 3. public class PrintingArgs {
private EventArgs eventArgs;
public PrintingArgs(EventArgs ea) {
this.eventArgs = ea;
}
public EventArgs Args {
get { return eventArgs; }
}}
Option 4. public class PrintingArgs : EventArgs {
private int copies;
}

Ans. Option 2

Please provide the reason below. The best provided reason will be displayed with your name(if you are logged-in) on website.
Enter Reason
 
Is it helpful? Yes No
©2024 WithoutBook